<!--
 * @Author: cqg
 * @Date: 2020-12-14 11:16:03
 * @LastEditTime: 2021-04-21 15:25:52
 * @Description: file content
 * @LastEditors: xjt
-->
<template>
  <div class="basic-from">
    <el-form :model="form" class="form-wrap">
      <p class="title full">财务决算</p>
      <el-form-item label="文号" prop="finalDocument">
        <el-input v-halfCharCode disabled v-model="form.finalDocument" placeholder="请输入" />
      </el-form-item>
      <el-form-item label="金额(元)" prop="finalAmount">
        <el-input disabled placeholder="请输入" :value="form.finalAmount | thousandMoney" />
      </el-form-item>
      <el-form-item label="决算日期" prop="finalDate">
        <el-date-picker disabled v-model="form.finalDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" />
      </el-form-item>
      <p class="title full">附件</p>
      <v-upload
        class="full"
        ref="finalCost"
        @loadCompleted="finalCostLoadCompleted"
        :busId="form.projectFinalId"
        modelType="finalCost"
        v-model="finalFileList"
        :isView="true"
      />
      <p class="title full">资产移交</p>
      <el-form-item label="文号" prop="transferDocument">
        <el-input v-halfCharCode disabled v-model="form.transferDocument" placeholder="请输入" />
      </el-form-item>
      <el-form-item label="金额(元)" prop="transferAmount">
        <el-input disabled placeholder="请输入" :value="form.transferAmount | thousandMoney" />
      </el-form-item>
      <el-form-item label="移交日期" prop="transferDate">
        <el-date-picker disabled v-model="form.transferDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" />
      </el-form-item>
      <p class="title full">附件</p>
    </el-form>

    <v-upload
      ref="transferAssets"
      @loadCompleted="transferLoadCompleted"
      :busId="form.projectTransferId"
      modelType="transferAssets"
      v-model="transferFileList"
      :isView="true"
    />
  </div>
</template>

<script>
export default {
  props: ['form'],
  data () {
    return {
      finalFileList: [],
      transferFileList: [],
    }
  },
  methods: {
    transferLoadCompleted (data) {
      this.$refs.transferAssets.loadFileList = data.filter(item => item.module === 'transferAssets')
    },
    finalCostLoadCompleted (data) {
      this.$refs.finalCost.loadFileList = data.filter(item => item.module === 'finalCost')
    },
  }
}
</script>